package mutsumimod.cards.custom;

import com.megacrit.cardcrawl.actions.AbstractGameAction;
import com.megacrit.cardcrawl.actions.common.ApplyPowerAction;
import com.megacrit.cardcrawl.actions.common.RemoveSpecificPowerAction;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.cards.DamageInfo;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.monsters.AbstractMonster;
import com.megacrit.cardcrawl.powers.AbstractPower;
import com.megacrit.cardcrawl.powers.DexterityPower;
import com.megacrit.cardcrawl.powers.StrengthPower;
import mutsumimod.actions.TrueDamageCallbackAction;
import mutsumimod.cards.BaseCard;
import mutsumimod.character.Mutsumi;
import mutsumimod.util.CardStats;

public class StrengthCucumber extends BaseCard {
    public static final String ID = makeID(StrengthCucumber.class.getSimpleName());
    public static final CardStats info = new CardStats(
            Mutsumi.Meta.CARD_COLOR,
            CardType.ATTACK,
            CardRarity.RARE,
            CardTarget.ENEMY,
            3
    );

    public StrengthCucumber() {
        super(ID, info);
        setAttr(2,0,0);
        setAttrUpg(1,0,0);
    }

    @Override
    public void use(AbstractPlayer p, AbstractMonster m) {
        addToBot(new TrueDamageCallbackAction(m, new DamageInfo(AbstractDungeon.player
                , damage, DamageInfo.DamageType.NORMAL), AbstractGameAction.AttackEffect.SLASH_VERTICAL,
                (dmg) -> {
                    if(dmg>0){
                        addToTop(new ApplyPowerAction(p,p,new StrengthPower(p,dmg),dmg));
                    }
                }
        ));
    }

    @Override
    public AbstractCard makeCopy() { //Optional
        return new StrengthCucumber();
    }
}
